<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    #canvas {
      border: 1px solid #333;
    }
  </style>
</head>

<body>
  <canvas id="canvas" width="300" height="300"></canvas>
  <script>
    let canvas = document.getElementById("canvas");
    let ctx = canvas.getContext("2d");
    /* 绘制第一个圆 */
    ctx.beginPath();
    ctx.arc(150, 150, 100, 0, Math.PI * 2);
    ctx.closePath();
    ctx.fillStyle = "red";
    ctx.fill();
    /* 第二个圆 */
    ctx.beginPath();
    ctx.arc(150, 150, 50, 0, Math.PI * 2);
    ctx.closePath();
    ctx.fillStyle = "green";
    ctx.fill();
  </script>
</body>

</html>